package com.example.sequences.core.jpa;

import org.hibernate.HibernateException;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.id.IdentifierGenerator;

import java.io.Serializable;

/**
 * Idprovider
 *
 * @author maxsc
 * @title Idprovider.java
 * @date 2018/5/8
 */
public class Idprovider implements IdentifierGenerator {
    @Override
    public Serializable generate(SessionImplementor sessionImplementor, Object o) throws HibernateException {
        return IdGenerator.getInstance().nextId("XC");
    }
}
